package top.tangyh.lamp.care.controller;


import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import top.tangyh.basic.base.R;
import top.tangyh.lamp.care.entity.*;
import top.tangyh.lamp.care.entity.oracle.ViewICUOnlinePatients;
import top.tangyh.lamp.care.service.*;
import top.tangyh.lamp.care.service.oralce.OracleViewService;
import top.tangyh.lamp.care.vo.query.*;
import top.tangyh.lamp.care.vo.result.*;
import top.tangyh.lamp.care.vo.save.PatientOtherInfoInVO;
import top.tangyh.lamp.common.utils.PDateUtils;

import javax.validation.Valid;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

/**
 * <p>
 * 前端控制器
 * 病人信息表
 * </p>
 *
 * @author zqb
 * @date 2024-07-12 16:37:12
 * @create [2024-07-12 16:37:12] [zqb] [代码生成器生成]
 */
@Slf4j
@RequiredArgsConstructor
@Validated
@RestController
@RequestMapping("/bPatient")
@Tag(name = "病人信息")
public class BPatientController {

    private final BPatientService bPatientService;


    private final LeavePatientsService leavePatientsService;

    private final BHl7RkDetailService bHl7RkDetailService;

    private final BHl7RyDetailService bHl7RyDetailService;

    private final BHl7YzYaoExeService bHl7YzYaoExeService;

    private final BHl7MoveDetailService bHl7MoveDetailService;

    private final IcuOnlinePatientsService icuOnlinePatientsService;

    private final BDevBindService bindService;

    private final HisPatientEventService hisPatientEventService;

    private  final HisOperationService hisOperationService;

    private final OracleViewService oracleViewService;


    @Operation(summary = "查询病人信息:不分页")
    @GetMapping("/list")
    public R<List<PatientInfoOutVO>> selectPatients() {
        List<PatientInfoOutVO> patientInfoList = bPatientService.selectListByQuery();
        return R.success(patientInfoList);
    }

    @Operation(summary = "台胞新接口：患者列表")
    @GetMapping("/list/new")
    public R<List<PatientInfoOutVONew>> selectPatientsListNew() {
        List<PatientInfoOutVONew> listP = new ArrayList<>();
        List<IcuOnlinePatients> list = icuOnlinePatientsService.list();
        // 升序排序，根据床号排序
        list.sort(Comparator.comparing(IcuOnlinePatients::getBedNumber));
        for (int i = 0; i < list.size(); i++) {
            IcuOnlinePatients icuOnlinePatients = list.get(i);
            PatientInfoOutVONew patientInfoOutVONew = new PatientInfoOutVONew();
            BPatientResultVO bPatient = bPatientService.selectOneByQuery(icuOnlinePatients.getHospitalNumber());
            patientInfoOutVONew.setId(bPatient.getId());
            patientInfoOutVONew.setNursingLevel(bPatient.getNursingLevel());
            patientInfoOutVONew.setPatientName(bPatient.getPatientName());
            patientInfoOutVONew.setAge(icuOnlinePatients.getAge());
            patientInfoOutVONew.setBedNumber(icuOnlinePatients.getBedNumber() + "");
            patientInfoOutVONew.setGender(icuOnlinePatients.getSex());
            patientInfoOutVONew.setRkTime(icuOnlinePatients.getRkTime());
            patientInfoOutVONew.setRkZdContent(icuOnlinePatients.getRkZdContent());
            patientInfoOutVONew.setHospitalNumber(icuOnlinePatients.getHospitalNumber());
            patientInfoOutVONew.setPatientIdent(icuOnlinePatients.getPatientIdent() + "");
            patientInfoOutVONew.setRyTime(icuOnlinePatients.getWardInTime());
            patientInfoOutVONew.setBirthday(bPatient.getBirthday());
            LocalDateTime ryTime = icuOnlinePatients.getWardInTime();
            if(null!=ryTime){
                // 获取当前时间
                LocalDateTime currentTime = LocalDateTime.now();

                // 计算入院天数
                long daysBetween = Duration.between(ryTime, currentTime).toDays();
                patientInfoOutVONew.setZyDaycount((int) daysBetween);
            }

            listP.add(patientInfoOutVONew);
        }
//        List<PatientInfoOutVO> patientInfoList = bPatientService.selectListByQuery();
        return R.success(listP);
    }

    public IcuOnlinePatients getPatientByHospitalNumber(List<IcuOnlinePatients> list, String hospitalNumber) {
        Optional<IcuOnlinePatients> patientOpt = list.stream()
                .filter(patient -> patient.getHospitalNumber().equals(hospitalNumber))
                .findFirst();  // 找到第一个匹配的患者

        return patientOpt.orElse(null);  // 如果没有找到，返回 null
    }

    @Operation(summary = " 查询患者更多信息")
    @GetMapping("/base/patient/more")
    public R<PatientMore> selectPatientsMore(String hospitalNumber) {
        List<IcuOnlinePatients> list = icuOnlinePatientsService.list();
        IcuOnlinePatients icuOne = getPatientByHospitalNumber(list, hospitalNumber);

       // BHl7RyDetail bHl7RyDetail=bHl7RyDetailService.selectLastRk(hospitalNumber);

        PatientMore patientInfoOutVO = new PatientMore();

        BPatientResultVO bPatientResultVO = bPatientService.selectOneByQuery(hospitalNumber);
        bPatientResultVO = (bPatientResultVO != null) ? bPatientResultVO : new BPatientResultVO(); // 使用默认对象

        patientInfoOutVO.setHospitalNumber(icuOne.getHospitalNumber());
        patientInfoOutVO.setAddress(bPatientResultVO.getAddress());
        patientInfoOutVO.setBirthday(bPatientResultVO.getBirthday());
        patientInfoOutVO.setPatientName(bPatientResultVO.getPatientName());
        patientInfoOutVO.setWardName(bPatientResultVO.getWardIdent());

        BHl7RkDetail rkDetail = bHl7RkDetailService.selectLastRk(hospitalNumber);
        rkDetail = (rkDetail != null) ? rkDetail : new BHl7RkDetail(); // 使用默认对象

        patientInfoOutVO.setWardName(rkDetail.getWardName());
        patientInfoOutVO.setWardIdent(rkDetail.getWardIdent());
        patientInfoOutVO.setPatientIdent(bPatientResultVO.getPatientIdent());
        patientInfoOutVO.setAge(bPatientResultVO.getAge());
        patientInfoOutVO.setPatientName(bPatientResultVO.getPatientName());
        patientInfoOutVO.setBedNumber(bPatientResultVO.getBedNumber());

        patientInfoOutVO.setGender(bPatientResultVO.getGender()); // 性别
        patientInfoOutVO.setContacts(bPatientResultVO.getContacts()); // 联系人
        patientInfoOutVO.setContactsPhone(bPatientResultVO.getContactsPhone()); // 联系人手机号
        patientInfoOutVO.setRelation(bPatientResultVO.getRelation()); // 联系人关系
        patientInfoOutVO.setBloodType(bPatientResultVO.getBloodType()); // 血型
        patientInfoOutVO.setWeight(bPatientResultVO.getWeight()); // 体重
        patientInfoOutVO.setNursingLevel(bPatientResultVO.getNursingLevel()); // 护理等级
        patientInfoOutVO.setHeight(bPatientResultVO.getHeight()); // 身高
        patientInfoOutVO.setZzDoctorName(rkDetail.getZzDoctorName()); // 主治医生名称
        patientInfoOutVO.setRkZdContent(icuOne.getRkZdContent()); // 入科诊断内容


        patientInfoOutVO.setRyTime(icuOne.getWardInTime()); // 入院时间

// 设置患者入科信息
        patientInfoOutVO.setRkTime(icuOne.getRkTime()); // 入科时间
        patientInfoOutVO.setCkTime(rkDetail.getCkTime()); // 出科时间

        List<HisOperation> hisOperationList=hisOperationService.selectHisOperationList(hospitalNumber);
        hisOperationList = (hisOperationList != null) ? hisOperationList : new ArrayList<>(); // 使用默认对象

        List<top.tangyh.lamp.care.vo.result.Operation> listOperation = new ArrayList<>();
        if(null!=hisOperationList){
            for (int i = 0; i < hisOperationList.size(); i++) {
                HisOperation hisOperation=hisOperationList.get(i);
                top.tangyh.lamp.care.vo.result.Operation operation=new top.tangyh.lamp.care.vo.result.Operation();
                operation.setId(hisOperation.getId());
                operation.setName(hisOperation.getOpsName());
                operation.setTime(hisOperation.getArrangeOpsTime());
                listOperation.add(operation);
            }
        }
      
        patientInfoOutVO.setListOperation(listOperation);
        // 设置手术记录（如果有）
        //  patientInfoOutVO.setListOperation(bPatientResultVO.getListOperation()); // 手术

        // 设置药物使用信息（如果有）
        Long rkTimeLong = PDateUtils.getTimestampOfDateTime(icuOne.getRkTime());
        List<RkYongYaoOutVO> rkYongYaoOutVOList = bHl7YzYaoExeService.listRkYongYaoOutVO(hospitalNumber, rkTimeLong);
        patientInfoOutVO.setListYao(rkYongYaoOutVOList); // 用药
        //patientInfoOutVO.setWardIdent(bHl7RyDetail.getPatientIdent());

        List<MoveInfoOutVO> moveInfoOutVOList = bHl7MoveDetailService.listMoveInfoInVO(hospitalNumber);
        // 设置归转记录（如果有）
        patientInfoOutVO.setListMove(moveInfoOutVOList); // 归转记录

        List<HisPatientEvent> hisPatientEventList = hisPatientEventService.getHisPatientEventListBy(hospitalNumber);
        // 设置患者事件信息（如果有）
        patientInfoOutVO.setListEvent(hisPatientEventList); // 患者事件

        return R.success(patientInfoOutVO);
    }

    @Operation(summary = "查询病人床位信息:不分页")
    @GetMapping("/bed")
    public R<List<PatientBedInfoOutVO>> selectPatientsBed() {

        List<PatientBedInfoOutVO> patientInfoList = bPatientService.selectListBedByQuery();
        return R.success(patientInfoList);
    }

//    @Operation(summary = "历史病人：查询某个病人信息 ")
//    @GetMapping("/base/history/one")
//    public R<PatientInfoOutVO> selectPatientsOfHistory(PatientInfoHistoryQueryVO queryVO) {
//
//        PatientInfoOutVO patientInfoOutVO = new PatientInfoOutVO();
//        return R.success(patientInfoOutVO);
//    }

    @Operation(summary = "修改病人基础信息")
    @PutMapping("/base")
    public R updateBaseInfo(@RequestBody @Valid PatBaseInfoInVO baseInfoInVO) {
        bPatientService.updatePatBaseInfo(baseInfoInVO);
        return R.success();
    }

    @Operation(summary = "修改病人其他信息")
    @PutMapping("/other")
    public R updateOtherInfo(@RequestBody @Valid PatientOtherInfoInVO otherInfoInVO) {
        bPatientService.updatePatOtherInfo(otherInfoInVO);
        return R.success();
    }

//    @Operation(summary = "查询病人首页数据")
//    @GetMapping("/home")
//    public R<List<PatientHomePageOutVO>> selectPatientsHomePage(PatientHomePageQueryVO queryVO) {
//        List<PatientHomePageOutVO> result = bPatientService.selectPatientsHomePage(queryVO);
//        return R.success(result);
//    }

//    @Operation(summary = "查询病人首页数据")
//    @GetMapping("/home")
//    public R<List<ViewICUOnlinePatients>> selectPatientsHomePage() {
//
//
////        List<IcuOnlinePatients> list = icuOnlinePatientsService.list();
//        List<ViewICUOnlinePatients> list= oracleViewService.selectHisIcuONLINEPATIENTSAll();
//
//        try {
//            // 定义总床位号范围，这里假设需要的床位号是 I01 到 I14
//            List<String> allBedNumbers = new ArrayList<>();
//            for (int i = 1; i <= 14; i++) {
//                allBedNumbers.add(String.format("I%02d", i));  // 生成床位号 I01, I02, ..., I14
//            }
//
//            // 获取数据库中已有的床位号
//            List<String> existingBedNumbers = list.stream()
//                    .map(ViewICUOnlinePatients::getBedNumber)
//                    .filter(Objects::nonNull)
//                    .collect(Collectors.toList());
//
//            // 找到缺少的床位号
//            allBedNumbers.removeAll(existingBedNumbers);
//
//            // 对缺少的床位号生成新的空记录
//            for (String missingBedNumber : allBedNumbers) {
//                ViewICUOnlinePatients emptyRecord = new ViewICUOnlinePatients();
//                emptyRecord.setBedNumber(missingBedNumber);
//                // 其他属性保持为空
//                emptyRecord.setHospitalNumber("");
//                emptyRecord.setPatientIdent(null);
//                emptyRecord.setName("");
//                emptyRecord.setAge(null);
//                emptyRecord.setSex(null);
//                emptyRecord.setWardInTime(null);
//                emptyRecord.setCreateTime(null);
//                emptyRecord.setModifyTime(null);
//                emptyRecord.setIsKongchuang(true);
//                emptyRecord.setBindDevList(Collections.emptyList());  // 空设备列表
//                list.add(emptyRecord);  // 将空记录添加到返回列表中
//            }
//
//            // 根据床位号排序，确保床位号顺序从 I01 到 I14
//            list.sort(Comparator.comparingInt(icuOnlinePatients -> {
//                String bedNumber = icuOnlinePatients.getBedNumber();
//                if (bedNumber != null && bedNumber.startsWith("I")) {
//                    try {
//                        // 提取数字部分并解析为整数进行排序
//                        return Integer.parseInt(bedNumber.substring(1));
//                    } catch (NumberFormatException e) {
//                        return Integer.MAX_VALUE;  // 解析失败时默认排最后
//                    }
//                }
//                return Integer.MAX_VALUE;
//            }));
//
//        } catch (Exception e) {
//            log.error(e.getMessage());
//        }
//
//
//        try {
//            if (null != list) {
//                // 根据 bedNumber 的数字部分进行排序
//
//
//                for (int i = 0; i < list.size(); i++) {
//                    ViewICUOnlinePatients icuOnlinePatients = list.get(i);
//                    PatientBindInputVO patientBindOutputVO = new PatientBindInputVO();
//                    if (null != icuOnlinePatients.getPatientIdent()) {
//                        patientBindOutputVO.setPatientIdent(String.valueOf(icuOnlinePatients.getPatientIdent()));
//                    }
//
//                    patientBindOutputVO.setHospitalNumber(icuOnlinePatients.getHospitalNumber());
//                    List<PatientBindOutputVO> listdev = bindService.queryPatientBindHome(patientBindOutputVO);
//                    List<String> devCodes = listdev.stream()
//                            .map(PatientBindOutputVO::getDevCode)  // Extract devCode from each PatientBindOutputVO
//                            .collect(Collectors.toList());  // Collect into a List<String>
//
//                    icuOnlinePatients.setBindDevList(devCodes);
//
//                    if(null==icuOnlinePatients.getIsKongchuang()){
//                        icuOnlinePatients.setIsKongchuang(false);
//                    }
//                }
//            }
//        } catch (Exception e) {
//            log.error(e.getMessage());
//        }
//
//
//       // IcuOnlinePatients icuOnlinePatients = BeanUtil.toBean(viewICUOnlinePatients, IcuOnlinePatients.class);
//
//        return R.success(list);
//    }

    @Operation(summary = "查询病人首页数据")
    @GetMapping("/home")
    public R<List<IcuOnlinePatients>> selectPatientsHomePage() {


        List<IcuOnlinePatients> list = icuOnlinePatientsService.list();
//        List<ViewICUOnlinePatients> list= oracleViewService.selectHisIcuONLINEPATIENTSAll();

        try {
            // 定义总床位号范围，这里假设需要的床位号是 I01 到 I14
            List<String> allBedNumbers = new ArrayList<>();
            for (int i = 1; i <= 14; i++) {
                allBedNumbers.add(String.format("I%02d", i));  // 生成床位号 I01, I02, ..., I14
            }

            // 获取数据库中已有的床位号
            List<String> existingBedNumbers = list.stream()
                    .map(IcuOnlinePatients::getBedNumber)
                    .filter(Objects::nonNull)
                    .collect(Collectors.toList());

            // 找到缺少的床位号
            allBedNumbers.removeAll(existingBedNumbers);

            // 对缺少的床位号生成新的空记录
            for (String missingBedNumber : allBedNumbers) {
                IcuOnlinePatients emptyRecord = new IcuOnlinePatients();
                emptyRecord.setBedNumber(missingBedNumber);
                // 其他属性保持为空
                emptyRecord.setHospitalNumber("");
                emptyRecord.setPatientIdent(null);
                emptyRecord.setName("");
                emptyRecord.setAge(null);
                emptyRecord.setSex(null);
                emptyRecord.setWardInTime(null);
                emptyRecord.setCreateTime(null);
                emptyRecord.setModifyTime(null);
                emptyRecord.setIsKongchuang(true);
                emptyRecord.setBindDevList(Collections.emptyList());  // 空设备列表
                list.add(emptyRecord);  // 将空记录添加到返回列表中
            }

            // 根据床位号排序，确保床位号顺序从 I01 到 I14
            list.sort(Comparator.comparingInt(icuOnlinePatients -> {
                String bedNumber = icuOnlinePatients.getBedNumber();
                if (bedNumber != null && bedNumber.startsWith("I")) {
                    try {
                        // 提取数字部分并解析为整数进行排序
                        return Integer.parseInt(bedNumber.substring(1));
                    } catch (NumberFormatException e) {
                        return Integer.MAX_VALUE;  // 解析失败时默认排最后
                    }
                }
                return Integer.MAX_VALUE;
            }));

        } catch (Exception e) {
            log.error(e.getMessage());
        }


        try {
            if (null != list) {
                // 根据 bedNumber 的数字部分进行排序


                for (int i = 0; i < list.size(); i++) {
                    IcuOnlinePatients icuOnlinePatients = list.get(i);
                    PatientBindInputVO patientBindOutputVO = new PatientBindInputVO();
                    if (null != icuOnlinePatients.getPatientIdent()) {
                        patientBindOutputVO.setPatientIdent(String.valueOf(icuOnlinePatients.getPatientIdent()));
                    }

                    patientBindOutputVO.setHospitalNumber(icuOnlinePatients.getHospitalNumber());
                    List<PatientBindOutputVO> listdev = bindService.queryPatientBindHome(patientBindOutputVO);
                    List<String> devCodes = listdev.stream()
                            .map(PatientBindOutputVO::getDevCode)  // Extract devCode from each PatientBindOutputVO
                            .collect(Collectors.toList());  // Collect into a List<String>

                    icuOnlinePatients.setBindDevList(devCodes);

                    if(null==icuOnlinePatients.getIsKongchuang()){
                        icuOnlinePatients.setIsKongchuang(false);
                    }
                }
            }
        } catch (Exception e) {
            log.error(e.getMessage());
        }


        // IcuOnlinePatients icuOnlinePatients = BeanUtil.toBean(viewICUOnlinePatients, IcuOnlinePatients.class);

        return R.success(list);
    }
    @Operation(summary = "历史病人 分页列表")
    @GetMapping("/history")
    public R<PageOutputDTO<Hl7RkDetailOutVO>> selectHistoryPatientsPage(PatientHistoryPageQueryVO queryVO) {
        PageOutputDTO<Hl7RkDetailOutVO> result = bHl7RkDetailService.selectHistoryPatientsPage(queryVO);
        return R.success(result);
    }


    /**
     * //            历史病人进去后 输入框 不可编辑的  开始时间 和结束时间
     * //            取值逻辑为：
     * //            开始时间 ：入科记录列表  为双击点击的入科时间
     * //            结束时间有  三种情况
     * //            1，结束时间为转入其他科的时间。
     * //            2，如果没有其他科的时间 就取 出院时间
     * //            3，如果没有出院时间就取当前时间
     *
     * @param patientIdent
     * @param hospitalNumber
     * @return
     */
    @Operation(summary = "历史病人关联的 入科记录")
    @GetMapping("/history/rklist")
    public R<List<BHl7MoveDetailResultVO>> selectRkListOfHistoryPatient(@RequestParam String patientIdent, @RequestParam String hospitalNumber) {

        List<BHl7MoveDetailResultVO> list=bHl7MoveDetailService.selectRkListOfHistoryTb(hospitalNumber);

        //没有出科时间 就拿患者的出院时间
        for (int i = 0; i < list.size(); i++) {
            BHl7MoveDetailResultVO bHl7MoveDetailResultVO=list.get(i);

            if(null==bHl7MoveDetailResultVO.getOutTime()){
                BHl7MoveDetailResultVO bHl7MoveDetailResultVO1=  bHl7MoveDetailService.selectCyTimeRecordByHospitalNumber(bHl7MoveDetailResultVO.getZrTime(),bHl7MoveDetailResultVO.getHospitalNumber());
                if(null!=bHl7MoveDetailResultVO1){
                    bHl7MoveDetailResultVO.setOutTime(bHl7MoveDetailResultVO1.getZcTime());
                }

            }
        }


//        List<Hl7RkDetailOutVO> result = bHl7RkDetailService.selectRkListOfHistoryPatientNew(patientIdent, hospitalNumber);
//        for (Hl7RkDetailOutVO item : result) {
//            if (CollectionUtil.isNotEmpty(item.getZrTime())) {
//                item.setEndTime(item.getZrTime().get(0));
//                item.setEndCkTime(item.getZrTime().get(0));
//            } else if (CollectionUtil.isNotEmpty(item.getEventTime())) {
//                item.setEndTime(item.getEventTime().get(0));
//                item.setEndCkTime(item.getEventTime().get(0));
//            } else {
//                item.setEndTime(item.getCkTimeA());
//                item.setEndCkTime(item.getCkTimeA());
//            }
//        }
//        if (CollectionUtil.isNotEmpty(result)) {
//            if (null == result.get(0).getEndCkTime() || null == result.get(0).getEndTime()) {
//                //如果没有出院时间，找对应病人的下一次的入院的第一次入科为结束时间
//                BHl7RkDetail nextrk = bHl7RkDetailService.selectRkByPatientIdentAndRkTime(result.get(0).getPatientIdent(), result.get(0).getRkTime(), result.get(0).getId());
//                if (null != nextrk) {
//                    result.get(0).setEndTime(nextrk.getRkTime());
//                    result.get(0).setEndCkTime(nextrk.getRkTime());
//                } else {
//                    result.get(0).setEndTime(LocalDateTime.now());
//                    result.get(0).setEndCkTime(LocalDateTime.now());
//                }
//            }
//
//        }


        return R.success(list);
    }


    //
//    @Operation(summary = "新增修改病人出入科时间配置")
//    @PostMapping("/config")
//    public R savePatientRkCkTimeConfig(@RequestBody @Valid RkCkTimeConfigVO rkCkTimeConfigVO) {
//        patientInfoService.saveConfig(rkCkTimeConfigVO);
//        return R.success();
//    }
//
    @Operation(summary = "已手动出科的病人列表")
    @GetMapping("/manual/leave")
    public R<List<LeavePatients>> selectLeavePatients() {
        List<LeavePatients> result = leavePatientsService.selectLeavePatients();
        return R.success(result);
    }

    @Operation(summary = "撤销出科")
    @PutMapping("/cancel/graduation")
    public R cancelGraduation(@RequestBody @Valid CancelPatient cancelPatient) {
        return R.success(leavePatientsService.cancelPatients(cancelPatient));
    }
//
//
//    @Operation(summary = "逻辑删除手动出科的病人")
//    @DeleteMapping("/delete/leave")
//    public R deleteLeavePatient(@RequestParam("id") Long id) {
//        leavePatientsService.deleteLeavePatient(id);
//        return R.success();
//    }
//
//    @Operation(summary = "设置病人床位号")
//    @PostMapping("/bed")
//    public R setBed(@RequestBody @Valid BedVO bedVO) {
//        return R.success(patientInfoService.setBed(bedVO));
//    }
//
//
//    @Operation(summary = "查询病人变更记录")
//    @GetMapping("/his")
//    public R<PatientHisOutVO> selectPatients(@RequestParam("hospitalNumber") String hospitalNumber) {
//        PatientHisOutVO patientInfoList = patientInfoService.getPatientHis(hospitalNumber);
//        return R.success(patientInfoList);
//    }
//
//    @Operation(summary = "设置病人诊断id")
//    @PostMapping("/setdig")
//    public R<PatientHisOutVO> setDig(@RequestBody @Valid YxPatientDigVO yxPatientDigVO) {
//        patientInfoService.setDig(yxPatientDigVO);
//        return R.success();
//    }
}


